<template>
	<web-view class="web-view" :webview-styles="webviewStyles" :src="info.vrUrl"
		:style="{width: windowW + 'px', height: windowH + 'px'}"></web-view>
</template>

<script>
	import {
		getVrInfo
	} from "@/api/summer.js"
	export default {
		data() {
			return {
				windowH: 0,
				windowW: 0,
				webviewStyles: {
					progress: {
						color: 'transparent'
					}
				},
				info: {}
			}
		},
		onLoad(option) {
			let vrId = option.vrId
			this.getVrInfos(vrId)
			try {
				const res = uni.getSystemInfoSync();
				this.windowW = res.windowWidth;
				this.windowH = res.windowHeight;
			} catch (e) {
				// error
			}
		},

		methods: {
			getVrInfos(vrId) {
				this.m_show("加载中");
				getVrInfo(vrId).then(res => {
					this.info = res.data;
					uni.setNavigationBarTitle({
						title: this.info.name
					})
					this.m_hide();
				})

			}
		}
	}
</script>